home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 November / macformat-043.iso / mac / Shareware Plus / Developers / OpenStack Rinaldi Collection / openstack-rinaldi-lib / Menu 2.1 (US) / Menu 2.1 (US).rsrc / HELP_5635 < prev    next >
Encoding:
Text File  |  1996-01-09  |  11.7 KB  |  236 lines

  1.  
  2.  
  3.                                                   Menu 2.1
  4.  
  5.                                            by Frédéric RINALDI
  6.  
  7.  
  8. DESCRIPTION
  9.    Menu 2.1 is the evolution of the well known MenuSet package. Plenty of enhancements have been added, in order to make Menu XCMD the most powerful and easy to use menu external ever used.
  10.  
  11. Major enhancements are :
  12. • The whole set has been compiled in just one XCMD of 16 Kb (26 Kb for 11
  13.    externals before).
  14. • Each item or subitem name is now parsed, in order to remove special 
  15.    formatting codes. Thus, "<B^257Item!√" is same as "item" for the XCMD.
  16. • Special formatting codes can be used in any command parameter.
  17. • Menu, item, subitem names and Command chars are automatically 
  18.    capitalized to preserve Human Interface Guidelines
  19. • The syntax has been homogenized in all commands :
  20.                  Menu <command>,<menu>,<item>,<subitem>
  21.    and when an additional param is needed, it is always in second place :
  22.                  Menu <command>,<special>,<menu>,<item>,<subitem>
  23.    So, you need now to specify the whole path for a subitem, the XCMD 
  24.    doesn't search anymore in menu, then submenu list of items. This allows 
  25.    now to have many identical subitems in a same menu.
  26. • For any item or subitem param, you can use either its name, or its number.
  27. • Everything has been forecast to prevent suppression of user File menu or
  28.    of its Quit item, and any modification out of guidelines of this item.
  29. • Install can now even install the File menu. In this case, it will add all the 
  30.    supplied items before the quit item.
  31. • Switch accepts now About and Help items that go under the Apple menu.
  32. • Many commands have been added to deal with item command, style, ICON or even SICN.
  33. • Extensive online help is available (you have to get the Result after calling to obtain the help text) :
  34.    typing           Menu "!" 
  35.    will return   "Version 2.1, © Frederic RINALDI 1989,1990,1991"
  36.    Typing          Menu "?" 
  37.    will return   "Type “Menu "?",<command>” to get help on a command"
  38.    Typing          Menu "?",<command>
  39.    will return   syntax help for that command.
  40.    Typing          Menu "=" 
  41.    will return   "<error> if any OR <ICON|SICN id> OR <styles list> OR <
  42.                        shortcut char> OR <menus count>"
  43. • When "*" is allowed anywhere in the syntax, it means either "all" most of the time, or "end" for Insert command.
  44. • The menu definition can now use either return or semi-colon as separator.
  45. • A special hack has been provided to allow SICN inserting using special 
  46.    formatting chars (like ^xxx for an ICON).
  47. • Menu is fully international, giving the right "File" and "Quit" name when you call Switch.
  48.  
  49. And, like for MenuSet 1.0 :
  50. • Menu 2.1 remains the only XCMD allowing to remove all HC menus 
  51.    except Apple, File & Edit menu. The File menu is fully customizable, and 
  52.    the Edit menu still allows Cut, Copy & Paste.
  53. • Even really powerful, it remains a simple to use as any HyperTalk 
  54.    statement. You will never have to deal with dummy menu IDs stored in 
  55.    global variables, just pass the names and it will do it for you.
  56. • Finally, like all of my externals, I will support it and regularly enhance it.
  57.  
  58. SYNTAX
  59.                     Menu <command> [<param 1>...,<param N>]
  60.  
  61. USING
  62.   The first command parameter will determine the action of Menu XCMD :
  63.  
  64. SWITCH
  65.         Menu "Switch"[,<About item>[,<help item>]]
  66.  
  67.    Hides all HC menus, leaving only the Apple, File & Edit menus. About & Help items will be placed under the Apple menu, File has only a Quit item and Edit keeps all working clipboard handling items.
  68.    Called for the first times, Switch hides the HC menus. Called a second time, it restores the original menuBar.
  69. HINT : Whatever is the wording you choose for About item, HC 1.2.x sends doMenu "About HyperCard...". So do a correct test in your handler.
  70.  
  71. REMOVE
  72.         Menu "Remove",<menu|*>[,<item|*>[,<subitem|*>]]
  73.  
  74.   Removes one or all menus, items of a menu or subitems of a submenu. "*" stands for all when used in place of any parameter.
  75.  
  76. INSTALL
  77.         Menu "Install",<menu def>[…,<menu def>]
  78.  
  79.    Installs one or many (up to ten) user menus in one call. MenuDef can any container or literal string containing :
  80.  
  81.         "Menu name
  82.          item 1, subitem 1.1,subitem 1.2
  83.          item 2
  84.          item 3, subitem 3.1"
  85.  
  86. or :
  87.  
  88. "Menu name;item 1, subitem 1.1,subitem 1.2;item 2;item 3, subitem 3.1"
  89.  
  90. CHANGE
  91.         Menu "Change",<new>,<menu>,<item>[,<subitem>]
  92.  
  93.    Changes the wording of any item or subitem. Using a comma separated list as new parameter, you can even add a submenu to any existing item, or with special formatting chars change its style, ICON, etc.
  94.  
  95. INSERT
  96.         Menu "Insert",<new>,<menu>,<before item|*>[,<before subitem|*>]
  97.  
  98.    Inserts a new item in a menu or a new subitem in a submenu. If you use 
  99. "*" as a param, the new item will be inserted at the end.
  100.  
  101. CHECK/UNCHECK
  102.         Menu "Check",<menu>,<item|*>[,<subitem|*>]
  103.         Menu "Uncheck",<menu>,<item|*>[,<subitem|*>]
  104.  
  105.    Checks or unchecks any item or subitem. "*" stands for all when used in place of any parameter, thus allowing to check all items in one call.
  106.  
  107. ENABLE/DISABLE
  108.         Menu "Enable",<menu>[,<item|*>[,<subitem|*>]]
  109.         Menu "Disable",<menu>[,<item|*>[,<subitem|*>]]
  110.  
  111.    Enables or disables a whole menu, or any item or subitem. "*" stands for all when used in place of any parameter, thus allowing to set all items in one call.
  112.  
  113. FIND
  114.         Menu "Find",<item or subitem>
  115.  
  116.    Allow to find in which menu/submenu is any item or subitem. You have to get the Result after calling to obtain a list of matching menus. Each line of the returned comma separated list contains a menu name, sometimes the submenu name and the number of the item in the menu or submenu..
  117.  
  118. LIST
  119.         Menu "List",<menu|*>[,<item|*>[,<*>]]
  120.  
  121.    List returns a list of menus, items or subitems. Depending on the params you pass, List wiil return :
  122.      Menu "List","*" ........................... comma separated list of menu names
  123.      Menu "List","menu"....................... menuDef of menu (see Install)
  124.      Menu "List","menu","*"................ list of items & subitems of menu
  125.      Menu "List","menu","item"............ item & list of subitems of submenu
  126.      Menu "List","menu","item","*"..... list of subitems of submenu
  127.  
  128.    You have to get the Result after calling to obtain the required list.
  129.    HINT : if the first item of the returned menus list is "File", then you already called Switch command.
  130.  
  131. COUNT
  132.         Menu "Count",<menu|*>[,<item|*>[,<*>]]
  133.  
  134.    Count returns the number of user menus, items in a menu or subitems in a submenu. Last param must always be "*". You have to get the Result after calling to obtain the resulting number.
  135.    If you ask for the number of menus after have called Switch, the File user menu will be one of the totalized menus. 
  136.  
  137. ISCHECKED/ISENABLED
  138.         Menu "IsChecked",<menu>,<item>[,<subitem>]
  139.         Menu "IsEnabled",<menu>[,<item>[,<subitem>]]
  140.  
  141.    Returns "true" or "false", allowing to know if the menu, item or subitem is checked or enables. You have to get the Result after calling to obtain the value.
  142.  
  143. GETCMD/SETCMD
  144.         Menu "GetCmd",<menu>,<item>[,<subitem>]
  145.         Menu "SetCmd",<Cmd char>,<menu>,<item>[,<subitem>]
  146.  
  147.    Returns or sets the command char of any item or subitem. You have to get the Result after calling GetCmd to obtain the cmd char.
  148.  
  149. GETICON/SETICON
  150.         Menu "GetIcon",<menu>,<item>[,<subitem>]
  151.         Menu "SetIcon",<ICON ID>,<menu>,<item>[,<subitem>]
  152.  
  153.    Returns or sets the associated ICON of any item or subitem. ICON ID must be greater than 256 but smaller than 512. You have to get the Result after calling GetIcon to obtain the ICON ID.
  154.  
  155. GETSTYLE/SETSTYLE
  156.         Menu "GetStyle",<menu>,<item>[,<subitem>]
  157.         Menu "SetStyle",<style>,<menu>,<item>[,<subitem>]
  158.  
  159.    Returns or sets the style of any item or subitem. You have to get the Result after calling GetStyle to obtain the style string.
  160.    Style is a one or many chars string which can contain :
  161. N (Normal), B (Bold), I (Italic), U (Underline), O (Outline), S (Shadow), 
  162. C (Condense), E (Extend)
  163.  
  164. GETSICN/SETSICN
  165.         Menu "GetSicn",<menu>,<item>[,<subitem>]
  166.         Menu "SetSicn",<SICN ID>,<menu>,<item>[,<subitem>]
  167.  
  168.    Returns or sets the associated SICN of any item or subitem. SICN ID must be greater than 256 but smaller than 512. You have to get the Result after calling GetSicn to obtain the SICN ID.
  169.  
  170.  
  171.    <New>, <Menu>, <item> and <subitem> parameters are always name strings, but you can even use a number for item (the order in menu) and subitem (the order in submenu). Any of these parameters, except Menu name can use the standard formatting chars recognized by the File Mgr, either at the beginning or at the end of the name string :
  172.  
  173.      ^XXX    associates an ICON resource to the item
  174.      !X        puts a mark before the item
  175.      <X        sets the style of the item (B, I, O, U, S)
  176.                 NOTE : a bug in the Menu Mgr prevents using <E (extend) and <C 
  177.                            (condense) in the string. Using one of these will cause the 
  178.                            item to be ignored. Rather use SetStyle (see later).
  179.      /X       associates a command key to the item
  180.      (         disables the item
  181.  
  182. and a special hack :
  183.      ¨XXX    associates an SICN resource to the item (¨ = option-u)
  184.  
  185. ERRORS
  186.    Finally, don't worry : the XCMD is really bullet-proof, and numerous errors strings are available in the Result when something goes wrong :
  187.        "Error : Menu not found"
  188.        "Error : Bad ICON or SICN ID (257 ≤ x ≤ 511)"
  189.        "Error : Item not found"
  190.        "Error : Subitem not found"
  191.        "Error : Missing parameter(s)"
  192.        "Error : Useless parameter(s)"
  193.        "Error : This item has no submenu"
  194.        "Error : File menu cannot be removed"
  195.        "Error : Quit item cannot be removed from File menu "
  196.        "Error : UserLevel must be ≥ 4"
  197.        "Error : Couldn't save current Edit menu"
  198.        "Error : No more than 10 user menus"
  199.        "Error : Bad menu name in param #x"
  200.        "Error : Must call Switch before installing File menu"
  201.        "Error : "*" not allowed in Change params"
  202.        "Error : No more than one subMenu level"
  203.        "Error : "*" not allowed in menu param for Insert"
  204.        "Error : "*" not allowed in menu param for Check/Uncheck"
  205.        "Error : Quit item of File menu cannot be checked"
  206.        "Error : Whole File menu cannot be disabled"
  207.        "Error : Quit item of File menu cannot be disabled"
  208.        "Error : Out of Memory"
  209.        "Error : "*" not allowed in IsEnabled params"
  210.        "Error : "*" not allowed in IsChecked params"
  211.        "Error : "*" not allowed in Get... params"
  212.        "Error : "*" not allowed in Set... params"
  213.        "Error : SetCmd not allowed for Quit items of File menu"
  214.        "Error : SetCmd not allowed for items having a submenu"
  215.        "Error : SetSicn not allowed for items having a submenu"
  216.        "Error : Unknown command"
  217.        "Error : Empty param #x"
  218.        "Error : File menu resource not found"
  219.        "Error : SubMenu not allowed for About item"
  220.        "Error : SubMenu not allowed for Help item"
  221.        "Error : Duplicate menu name"
  222.  
  223. HISTORY
  224. 2.1                                                                                         8/15/91
  225. • Changed submenus IDs to be HC 2.0 compatible
  226. • Cleaned the code
  227. • Added "=" online help param
  228. --------------------------------------------------------------------
  229.    All externals included in this stack are FreeWare and may be used in non-commercial software provided the following notice is visibly present :
  230.  
  231.                    Menu XCMD, © Frederic Rinaldi, 1989…1993.
  232.  
  233.    Free for non-commercial use. Use in commercial software subjected to prior acknowledgement and licensing from the author, reachable at the following network addresses:
  234.  
  235. AppleLink: RINALDI1   CalvaCom : FR10    Compuserve : 71170,2111
  236.                Internet : RINALDI1@APPLELINK@APPLE.COM